export const getListener = () => {
  const handler = (e:any) => {
    e.returnValue = ''
  }
  const windowBeforeunload = () => {
    window.addEventListener('beforeunload', handler)
  }
  const removeWindowBfunload = () => {
    window.removeEventListener('beforeunload', handler)
  }

  return {
    windowBeforeunload,
    removeWindowBfunload
  }
}
